#include <iostream>
#include <string>
#include <bitset>
#include <ranges>

static const size_t MAX_LEN {(size_t)2e3+5};
static std::string s,p;
static constexpr auto range {std::ranges::views::iota};

static std::bitset<MAX_LEN> dp[MAX_LEN];

int main(){
    const auto get_p = [](const size_t n)noexcept->const char&{return p[n-1];};
    const auto get_s = [](const size_t n)noexcept->const char&{return s[n-1];};

    std::cin>>s>>p;

    dp[0][0] = true;

    for(const size_t j:range((size_t)1,p.size()+1)){
        if(get_p(j)!='*'){
            break;
        }
        dp[0][j]=true;
    }

    for(const size_t i:range((size_t)1,s.size()+1)){
        for(const size_t j:range((size_t)1,p.size()+1)){
            if(get_s(i) == get_p(j) || get_p(j)=='?'){
                dp[i][j] = dp[i-1][j-1];
            }else if(get_p(j)=='*'){
                dp[i][j] = dp[i-1][j] || dp[i][j-1]; //01背包，查看是否使用这个字符
            }
        }
    }
    std::cout<<(dp[s.size()][p.size()]==true?"yes":"no")<<'\n';
}